package designpattern.create.single;

/**
 * Created by cuihao on 2017/10/23.
 * 懒汉    线程安全而且具备lazy loading特点，但是性能低
 */

public class LazySingleton {
    private static LazySingleton lazySingleton;

    private LazySingleton() {
    }

    public static synchronized LazySingleton getInstance() {
        if (lazySingleton == null) {
            lazySingleton = new LazySingleton();
        }
        return lazySingleton;
    }
}
